
#ifndef		PARAM_READER_H
#define		PARAM_READER_H

#include <fstream>

//reads param file 
class ParamReader
{
public:

	static bool load(const char* fname); 
	static void print(); 

	//Experiment	
	static int		EXP_NUM_RUNS;						//number of trials (for statistical significant)
	static int		EXP_NUM_EPISODES;					//number of episodes in each run
	static int		EXP_NUM_STEPS;						//max number of steps in each episode
	static int		EXP_TYPE;							//type of experiment: (0) planning, (1) offline learning, (2) online learning	


	//Qlearner Agent
	static int		AGNT_TILE_RESOLUTION; 
	static int		AGNT_NUMBER_OF_TILINGS; 
	static double	AGNT_EPSILON;                    // probability of random action
	static double	AGNT_BETA;
	static double	AGNT_ALPHA;                      // step size parameter
	static double	AGNT_LAMBDA;                     // trace-decay parameters
	static bool		LOAD_MODEL					;		//whether load the previous experience or not 
	static bool		SAVE_MODEL					;		//whether save the state to be used later

private:
	static int readInt(const char* name, int& value);
	static double readDouble(const char* name, double& value); 
	static char* readString(const char* name, char*& value); 
	static bool readBool(const char* name, bool& value); 

	static std::ifstream cfgFile; 
	static bool skip2param(const char* tag);
	static char getNextChar(std::ifstream& cfg); 

};



#endif
